# Contributor: Bjoern Schilberg <bjoern@intevation.de>
# Contributor: Holger Jaekel <holger.jaekel@gmx.de>
# Maintainer: Holger Jaekel <holger.jaekel@gmx.de>
pkgname=postgis
pkgver=3.5.0
pkgrel=2
pkgdesc="spatial database extender for PostgreSQL object-relational database"
url="https://postgis.net/"
arch="all"
license="GPL-2.0-or-later"
depends="perl"
makedepends="
	gdal-dev
	geos-dev
	json-c-dev
	libxml2-dev
	pcre2-dev
	perl-dev
	postgresql-dev
	proj-dev
	protobuf-c-dev
	sfcgal-dev
	"
subpackages="$pkgname-doc"
source="https://download.osgeo.org/postgis/source/postgis-$pkgver.tar.gz"
options="!check" # tests depends on a running PostgreSQL server

prepare() {
	default_prepare
	update_config_sub
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr
	make
}

package() {
	depends="$depends postgresql$(pg_config --major-version)"

	make DESTDIR="$pkgdir" install
}

sha512sums="
baf81b9133db34c87ecb5e019497df89fba9faf293ae2f2e4fa5578dbe608ff5310b5ca718a7bf94e76af51bf7b8ec4b1f69fad91412017d70cdcd70492ae9e5  postgis-3.5.0.tar.gz
"
